package org.effdom.io;

import java.io.IOException;
import java.io.OutputStream;

import org.effdom.Document;

/**
 * The <code>DocumentWriter</code> is used to convert an EffDom document
 * to the EffDom protocol format.
 * 
 * @author <a href="mailto:mattias@effcode.com">Mattias Jonsson</a>
 *
 */
public interface DocumentWriter {
    
    /**
     * Writes the specified <code>Document</code> to the specified output stream.
     * 
     * @param doc the <code>Document</code> to be written
     * @param stream the stream used for export of the document
     * @throws IOException if some errors occurs during transformation 
     * @throws IllegalArgumentException if input data were illegal
     */
    public void write(Document doc, OutputStream stream) throws IOException, IllegalArgumentException;

}
